//app.js
App({
  onLaunch: function (options) {
    // 判断是否由分享进入小程序
    if (options.scene == 1007 || options.scene == 1008) {
      this.globalData.share = true
    } else {
      this.globalData.share = false
    };
    //获取设备顶部窗口的高度（不同设备窗口高度不一样，根据这个来设置自定义导航栏的高度）
    wx.getSystemInfo({
      success: res => {
        console.log(res)
        this.globalData.wHeight = res.windowHeight
        this.globalData.height = res.statusBarHeight
        this.globalData.isiOS = res.system.indexOf('iOS') > -1
        this.globalData.isX = res.model == 'iPhone X'
      }
    })
  },
  globalData: {
    share: false,
    height: 0,
    wHeight: 0,
    userData: null,
    ownCode: '',
    perms: [],
    enterpriseId: null,
    isService: false,
    isiOS: false,
    isX: false,
    writeProgress: false,
    formId: null,
    formAbId: null
  }
})